package view.balance;

import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JButton;

public class BalanceView extends JPanel{
	private JComboBox comboBox;
	private JTextField textField;
	private JTextField textField_1;
	private JButton btnSave;
	private JLabel lblClick;
	private JButton btnUpdate;
	public BalanceView() {
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JLabel lblSellerName = new JLabel("SELLER NAME:");
		springLayout.putConstraint(SpringLayout.NORTH, lblSellerName, 46, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblSellerName, 32, SpringLayout.WEST, this);
		add(lblSellerName);
		
		comboBox = new JComboBox();
		springLayout.putConstraint(SpringLayout.NORTH, comboBox, 40, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, comboBox, 16, SpringLayout.EAST, lblSellerName);
		springLayout.putConstraint(SpringLayout.EAST, comboBox, 96, SpringLayout.EAST, lblSellerName);
		add(comboBox);
		
		JLabel lblTotalAmount = new JLabel("TOTAL AMOUNT:");
		springLayout.putConstraint(SpringLayout.NORTH, lblTotalAmount, 30, SpringLayout.SOUTH, lblSellerName);
		springLayout.putConstraint(SpringLayout.WEST, lblTotalAmount, 0, SpringLayout.WEST, lblSellerName);
		add(lblTotalAmount);
		
		textField = new JTextField();
		springLayout.putConstraint(SpringLayout.WEST, textField, 14, SpringLayout.EAST, lblTotalAmount);
		springLayout.putConstraint(SpringLayout.SOUTH, textField, 0, SpringLayout.SOUTH, lblTotalAmount);
		add(textField);
		textField.setColumns(10);
		
		JLabel lblAmountPaid = new JLabel("AMOUNT PAID:");
		springLayout.putConstraint(SpringLayout.NORTH, lblAmountPaid, 28, SpringLayout.SOUTH, lblTotalAmount);
		springLayout.putConstraint(SpringLayout.WEST, lblAmountPaid, 0, SpringLayout.WEST, lblSellerName);
		add(lblAmountPaid);
		
		textField_1 = new JTextField();
		springLayout.putConstraint(SpringLayout.WEST, textField_1, 0, SpringLayout.WEST, comboBox);
		springLayout.putConstraint(SpringLayout.SOUTH, textField_1, 0, SpringLayout.SOUTH, lblAmountPaid);
		add(textField_1);
		textField_1.setColumns(10);
		
		JLabel lblDate = new JLabel("DATE:");
		springLayout.putConstraint(SpringLayout.NORTH, lblDate, 0, SpringLayout.NORTH, lblSellerName);
		springLayout.putConstraint(SpringLayout.WEST, lblDate, 43, SpringLayout.EAST, comboBox);
		add(lblDate);
		
		lblClick = new JLabel("CLICK");
		
		springLayout.putConstraint(SpringLayout.NORTH, lblClick, 0, SpringLayout.NORTH, lblSellerName);
		springLayout.putConstraint(SpringLayout.WEST, lblClick, 17, SpringLayout.EAST, lblDate);
		add(lblClick);
		
		btnSave = new JButton("SAVE");
		btnSave.setActionCommand("SAVE");
		springLayout.putConstraint(SpringLayout.EAST, btnSave, 0, SpringLayout.EAST, comboBox);
		add(btnSave);
		
		btnUpdate = new JButton("UPDATE");
		btnUpdate.setActionCommand("UPDATE");
		springLayout.putConstraint(SpringLayout.NORTH, btnSave, 0, SpringLayout.NORTH, btnUpdate);
		springLayout.putConstraint(SpringLayout.WEST, btnUpdate, 214, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, btnUpdate, -71, SpringLayout.SOUTH, this);
		add(btnUpdate);
	}
	public JComboBox getComboBox() {
		return comboBox;
	}
	public void setComboBox(JComboBox comboBox) {
		this.comboBox = comboBox;
	}
	public JTextField getTextField() {
		return textField;
	}
	public void setTextField(JTextField textField) {
		this.textField = textField;
	}
	public JTextField getTextField_1() {
		return textField_1;
	}
	public void setTextField_1(JTextField textField_1) {
		this.textField_1 = textField_1;
	}
	public JButton getBtnSave() {
		return btnSave;
	}
	public void setBtnSave(JButton btnSave) {
		this.btnSave = btnSave;
		
	}
	
	public JLabel getLblClick() {
		return lblClick;
	}
	public void setLblClick(JLabel lblClick) {
		this.lblClick = lblClick;
	}
	
	public JButton getBtnUpdate() {
		return btnUpdate;
	}
	public void setBtnUpdate(JButton btnUpdate) {
		this.btnUpdate = btnUpdate;
	}
	public void actionlisteners(ActionListener al)
	{
		this.btnSave.addActionListener(al);
		this.btnUpdate.addActionListener(al);
	}
}
